#pragma once

#include "KeyboardHook.hpp"
#include "Hook.hpp"




/**
 * The KeyboardHookHelper class helps to connect KeyboardHook instances with
 * the plain old Win32 hooks procedure, registered with windows.
 *
 * The class registers a static function (keyboardHook in this case) with windows,
 * through SetWindowsHookEx and forwards those messages to the only static instance
 * of KeyboardHookHelper.
 */
class KeyboardHookHelper : public Hook<KeyboardHook,WH_KEYBOARD>
{
public:

	KeyboardHookHelper();
	~KeyboardHookHelper();

private:

	/**
	 * This function does some message preprocessing and then dispatches
	 * the messages to all instances of KeyboardHook.
	 */
	LRESULT keyboardProc(int nCode, WPARAM wParam, LPARAM lParam) const;



	/**
	 * The static hook callback function that is registered with windows.
	 */
	static LRESULT CALLBACK keyboardHook(int nCode, WPARAM wParam, LPARAM lParam);
};
///////////////////////////////////////////////////////////////////////////////////////////////////
